<!DOCTYPE html>
<html lang="zh-cmn-Hans-CN">

<head>
    <meta charset="utf-8">
    <!-- 优先使用IE最新版本和 Chrome -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <!-- 360 浏览器内核控制 -->
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <!-- 控制手机和平板的显示比例 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- SEO 三项优化 -->
    <!-- 页面描述 -->
    <meta name="description" content="" />
    <!-- 页面关键词 -->
    <meta name="keywords" content="" />
    <!-- 页面标题 -->
    <title>教学工作小工具</title>
    <!-- Bootstrap core CSS -->
    <link href="<?php echo base_url();?>application/views/bootstrap/css/bootstrap.css" rel="stylesheet">
    <!-- 自定义样式表 -->
    <link href="<?php echo base_url() ?>application/views/css/main.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <div id="container">
        <header class="navbar">
            <div class="container">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="<?php echo site_url();?>">首页</a>
                </div>
                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="navbar-collapse-1">
                    <ul class="nav navbar-nav">
                        <li><a href="<?php echo site_url('teachinglog'); ?>">教学日志</a></li>
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="<?php echo site_url('/user/register_form/');?>">注册</a></li>
                        <?php if(!isset($this->session->userdata['email'])): ?>
                        <li><a href="<?php echo site_url('/user/login_form/'); ?>">登录</a></li>
                        <?php else: ?>
                        <li><a href="<?php echo site_url('/user/logout/'); ?>"><?php echo $this->session->userdata['email']; ?></a></li>
                        <?php endif; ?>
                    </ul>
                </div>
                <!-- /.navbar-collapse -->
            </div>
            <!-- /.container -->
        </header>
    </div>
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <div class='container main'>
        <form class="form-horizontal" action="<?php echo site_url('teachinglog/generation'); ?>" method="post">
            <div class="form-group">
                <label class="col-sm-2 control-label">开学日期</label>
                <div class="col-sm-10">
                    <input type="date" class="form-control" placeholder="开学日期" name="startdate" value="2017-8-28">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">课程名称</label>
                <div class="col-sm-10">
                    <select class="form-control" id="subject" name="subject">
                        <option value="PHP网站开发">PHP网站开发</option>
                        <option value="社会调查原理与方法">社会调查原理与方法</option>
                        <option value="市场调查与分析">市场调查与分析</option>
                        <option value="网页设计与制作">网页设计与制作</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">总学时</label>
                <div class="col-sm-10">
                    <select class="form-control" id="totalclasshour" name="totalclasshour" onchange="change()">
                        <option value="36">36</option>
                        <option value="54">54</option>
                        <option value="72">72</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">起始周</label>
                <div class="col-sm-10">
                    <select class="form-control" id="startweek" name="startweek">
                        <!-- option[value="$"]{$}*18 -->
                        <option value="1">1</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                        <option value="4">4</option>
                        <option value="5">5</option>
                        <option value="6">6</option>
                        <option value="7">7</option>
                        <option value="8">8</option>
                        <option value="9">9</option>
                        <option value="10">10</option>
                        <option value="11">11</option>
                        <option value="12">12</option>
                        <option value="13">13</option>
                        <option value="14">14</option>
                        <option value="15">15</option>
                        <option value="16">16</option>
                        <option value="17">17</option>
                        <option value="18">18</option>
                    </select>
                </div>
            </div>
            <fieldset id="total36">
                <legend>课程安排信息</legend>
                <div class="alert alert-success" role="alert">总学时36学时，每周一次课程。</div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">星期</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="week">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="1">一</option>
                            <option value="2">二</option>
                            <option value="3">三</option>
                            <option value="4">四</option>
                            <option value="5">五</option>
                            <option value="6">六</option>
                            <option value="7">日</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">第几节</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="dayseg1">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="12">12</option>
                            <option value="34">34</option>
                            <option value="56">56</option>
                            <option value="78">78</option>
                            <option value="90">90</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">上课地点</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="location1" placeholder="上课地点" value="四院部B12">
                    </div>
                </div>
            </fieldset>
            <fieldset id="total54">
                <legend>课程安排信息</legend>
                <div class="alert alert-success" role="alert">总学时54学时，每两周三次课程。</div>
                <h3>第一次课程安排</h3>
                <div class="form-group">
                    <label class="col-sm-2 control-label">单双周</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" name="isOddWeek1" value="1"> 单周
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="isOddWeek1" value="2"> 双周
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">星期</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="week1">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="1">一</option>
                            <option value="2">二</option>
                            <option value="3">三</option>
                            <option value="4">四</option>
                            <option value="5">五</option>
                            <option value="6">六</option>
                            <option value="7">日</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">第几节</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="dayseg1">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="12">12</option>
                            <option value="34">34</option>
                            <option value="56">56</option>
                            <option value="78">78</option>
                            <option value="90">90</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">上课地点</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="location1" value="四院部B12">
                    </div>
                </div>
                <h3>第二次课程安排</h3>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">单双周</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" name="isOddWeek2" id="inlineRadio1" value="1"> 单周
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="isOddWeek2" id="inlineRadio2" value="2"> 双周
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">星期</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="week2">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="1">一</option>
                            <option value="2">二</option>
                            <option value="3">三</option>
                            <option value="4">四</option>
                            <option value="5">五</option>
                            <option value="6">六</option>
                            <option value="7">日</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">第几节</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="dayseg2">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="12">12</option>
                            <option value="34">34</option>
                            <option value="56">56</option>
                            <option value="78">78</option>
                            <option value="90">90</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">上课地点</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="location2" value="四院部B12">
                    </div>
                </div>
                <h3>第三次课程安排</h3>
                <div class="form-group">
                    <label class="col-sm-2 control-label">单双周</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" name="isOddWeek3" value="1"> 单周
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="isOddWeek3" value="2"> 双周
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">星期</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="week3">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="1">一</option>
                            <option value="2">二</option>
                            <option value="3">三</option>
                            <option value="4">四</option>
                            <option value="5">五</option>
                            <option value="6">六</option>
                            <option value="7">日</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">第几节</label>
                    <div class="col-sm-10">
                        <select class="form-control" name="dayseg3">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="12">12</option>
                            <option value="34">34</option>
                            <option value="56">56</option>
                            <option value="78">78</option>
                            <option value="90">90</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">上课地点</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="location3" value="四院部B12">
                    </div>
                </div>
            </fieldset>
            <fieldset id="total72">
                <legend>课程安排信息</legend>
                <div class="alert alert-success" role="alert">总学时72学时，每周两次课程。</div>
                <h3>第一次课程安排</h3>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">星期</label>
                    <div class="col-sm-10">
                        <select class="form-control" id="classhour">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="1">一</option>
                            <option value="2">二</option>
                            <option value="3">三</option>
                            <option value="4">四</option>
                            <option value="5">五</option>
                            <option value="6">六</option>
                            <option value="7">日</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">第几节</label>
                    <div class="col-sm-10">
                        <select class="form-control" id="classhour">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="12">12</option>
                            <option value="34">34</option>
                            <option value="56">56</option>
                            <option value="78">78</option>
                            <option value="90">90</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">上课地点</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="inputEmail3" placeholder="上课地点">
                    </div>
                </div>
                <h3>第二次课程安排</h3>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">星期</label>
                    <div class="col-sm-10">
                        <select class="form-control" id="classhour">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="1">一</option>
                            <option value="2">二</option>
                            <option value="3">三</option>
                            <option value="4">四</option>
                            <option value="5">五</option>
                            <option value="6">六</option>
                            <option value="7">日</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">第几节</label>
                    <div class="col-sm-10">
                        <select class="form-control" id="classhour">
                            <!-- option[value="$"]{$}*18 -->
                            <option value="12">12</option>
                            <option value="34">34</option>
                            <option value="56">56</option>
                            <option value="78">78</option>
                            <option value="90">90</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">上课地点</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="inputEmail3" placeholder="上课地点">
                    </div>
                </div>
            </fieldset>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-default" id="go">自动生成</button>
                </div>
            </div>
        </form>
    </div>
    <div class='container footer'>
        <p class="text-center">yangzh.cn</p>
    </div>
    <script src="<?php echo base_url(); ?>application/views/jQuery/jquery-3.2.1.min.js"></script>
    <script src="<?php echo base_url(); ?>application/views/bootstrap/js/bootstrap.js"></script>
    <script>
    // 根据学时改变课程安排信息内容
    function change() {
        var totalclasshour = Number($('#totalclasshour option:selected').text());
        if (totalclasshour == 36) {
            $('#total54,#total72').hide();
            $('#total36').show();
        } else {
            if (totalclasshour == 54) {
                $('#total36,#total72').hide();
                $('#total54').show();
            } else {
                $('#total72').show();
                $('#total36,#total54').hide();
            }
        }
    }

    $(document).ready(function() {
        // 初始化总学时选项
        $("#totalclasshour").find("option[value='36']").attr("selected", true);
        // 初始化课程安排信息
        $('#total36').show();
        $('#total54,#total72').hide();
    });
    </script>
</body>

</html>
